package com.vip.wallet.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.vip.wallet.dao.Address;
import com.vip.wallet.dao.Card;
import com.vip.wallet.dao.CardPkg;
import com.vip.wallet.dao.Contact;
import com.vip.wallet.dao.PushMessage;
import com.vip.wallet.dao.SelectToken;
import com.vip.wallet.dao.Token;
import com.vip.wallet.dao.Wallet;

import com.vip.wallet.dao.AddressDao;
import com.vip.wallet.dao.CardDao;
import com.vip.wallet.dao.CardPkgDao;
import com.vip.wallet.dao.ContactDao;
import com.vip.wallet.dao.PushMessageDao;
import com.vip.wallet.dao.SelectTokenDao;
import com.vip.wallet.dao.TokenDao;
import com.vip.wallet.dao.WalletDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig addressDaoConfig;
    private final DaoConfig cardDaoConfig;
    private final DaoConfig cardPkgDaoConfig;
    private final DaoConfig contactDaoConfig;
    private final DaoConfig pushMessageDaoConfig;
    private final DaoConfig selectTokenDaoConfig;
    private final DaoConfig tokenDaoConfig;
    private final DaoConfig walletDaoConfig;

    private final AddressDao addressDao;
    private final CardDao cardDao;
    private final CardPkgDao cardPkgDao;
    private final ContactDao contactDao;
    private final PushMessageDao pushMessageDao;
    private final SelectTokenDao selectTokenDao;
    private final TokenDao tokenDao;
    private final WalletDao walletDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        addressDaoConfig = daoConfigMap.get(AddressDao.class).clone();
        addressDaoConfig.initIdentityScope(type);

        cardDaoConfig = daoConfigMap.get(CardDao.class).clone();
        cardDaoConfig.initIdentityScope(type);

        cardPkgDaoConfig = daoConfigMap.get(CardPkgDao.class).clone();
        cardPkgDaoConfig.initIdentityScope(type);

        contactDaoConfig = daoConfigMap.get(ContactDao.class).clone();
        contactDaoConfig.initIdentityScope(type);

        pushMessageDaoConfig = daoConfigMap.get(PushMessageDao.class).clone();
        pushMessageDaoConfig.initIdentityScope(type);

        selectTokenDaoConfig = daoConfigMap.get(SelectTokenDao.class).clone();
        selectTokenDaoConfig.initIdentityScope(type);

        tokenDaoConfig = daoConfigMap.get(TokenDao.class).clone();
        tokenDaoConfig.initIdentityScope(type);

        walletDaoConfig = daoConfigMap.get(WalletDao.class).clone();
        walletDaoConfig.initIdentityScope(type);

        addressDao = new AddressDao(addressDaoConfig, this);
        cardDao = new CardDao(cardDaoConfig, this);
        cardPkgDao = new CardPkgDao(cardPkgDaoConfig, this);
        contactDao = new ContactDao(contactDaoConfig, this);
        pushMessageDao = new PushMessageDao(pushMessageDaoConfig, this);
        selectTokenDao = new SelectTokenDao(selectTokenDaoConfig, this);
        tokenDao = new TokenDao(tokenDaoConfig, this);
        walletDao = new WalletDao(walletDaoConfig, this);

        registerDao(Address.class, addressDao);
        registerDao(Card.class, cardDao);
        registerDao(CardPkg.class, cardPkgDao);
        registerDao(Contact.class, contactDao);
        registerDao(PushMessage.class, pushMessageDao);
        registerDao(SelectToken.class, selectTokenDao);
        registerDao(Token.class, tokenDao);
        registerDao(Wallet.class, walletDao);
    }
    
    public void clear() {
        addressDaoConfig.getIdentityScope().clear();
        cardDaoConfig.getIdentityScope().clear();
        cardPkgDaoConfig.getIdentityScope().clear();
        contactDaoConfig.getIdentityScope().clear();
        pushMessageDaoConfig.getIdentityScope().clear();
        selectTokenDaoConfig.getIdentityScope().clear();
        tokenDaoConfig.getIdentityScope().clear();
        walletDaoConfig.getIdentityScope().clear();
    }

    public AddressDao getAddressDao() {
        return addressDao;
    }

    public CardDao getCardDao() {
        return cardDao;
    }

    public CardPkgDao getCardPkgDao() {
        return cardPkgDao;
    }

    public ContactDao getContactDao() {
        return contactDao;
    }

    public PushMessageDao getPushMessageDao() {
        return pushMessageDao;
    }

    public SelectTokenDao getSelectTokenDao() {
        return selectTokenDao;
    }

    public TokenDao getTokenDao() {
        return tokenDao;
    }

    public WalletDao getWalletDao() {
        return walletDao;
    }

}
